package com.hoshiicloud.shxping.feign.hystrix;

import com.hoshiicloud.common.rpc.Response;
import com.hoshiicloud.shxping.dto.UploadFileResponse;
import com.hoshiicloud.shxping.feign.IFileServerFeignClient;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author yangcheng
 * @version 1.0
 * @title: HystrixFileServerFeignFallback
 * @description: 文件服务FeignClient熔断器
 * @date 2019/8/5 15:50
 * @mail maiboyc@163.com
 */
public class HystrixFileServerFeignFallback implements IFileServerFeignClient {

    /**
     * 上传文件
     * @param bucketName 存储空间名称，上传时指定的存储空间
     * @param objectKey 文件key,上传时存储的对象key，上传完毕后原样返回，如不传则使用文件MD5值。
     * @param fileName 文件名,批量上传时需和key对应
     * @param folder 文件夹路径
     * @param privateOwned 对象私有读写
     * @param file 文件
     * @return Response
     */
    @Override
    public Response<UploadFileResponse> uploadFile(String bucketName, String objectKey, String fileName, String folder, Boolean privateOwned, MultipartFile file) {
        return Response.failed("上传文件失败");
    }

    @Override
    public Response uploadFile(MultipartFile file, String bucketName, String objectKey, String fileName, String folder, Boolean privateOwned) {
        return null;
    }

}
